this.BX=this.BX||{};this.BX.Landing=this.BX.Landing||{};this.BX.Landing.Ui=this.BX.Landing.Ui||{};this.BX.Landing.Ui.Panel=this.BX.Landing.Ui.Panel||{};this.BX.Landing.Ui.Panel.Formsettingspanel=this.BX.Landing.Ui.Panel.Formsettingspanel||{};(function(e,t,n,r,i,a,s,o,l){"use strict";function c(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function g(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?c(Object(n),!0).forEach((function(t){babelHelpers.defineProperty(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):c(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}var u=function(e){babelHelpers.inherits(n,e);function n(e){var t;babelHelpers.classCallCheck(this,n);t=babelHelpers.possibleConstructorReturn(this,babelHelpers.getPrototypeOf(n).call(this,e));t.setEventNamespace("BX.Landing.UI.Panel.FormSettingsPanel.Callback");t.addItem(t.getHeader());if(!t.isAvailable()){t.addItem(t.getWarningMessage());t.getSettingsForm().disable()}t.addItem(t.getSettingsForm());return t}babelHelpers.createClass(n,[{key:"getHeader",value:function e(){return this.cache.remember("header",(function(){return new s.HeaderCard({title:r.Loc.getMessage("LANDING_FORM_SETTINGS_CALLBACK_TITLE")})}))}},{key:"getWarningMessage",value:function e(){return this.cache.remember("warningMessage",(function(){return new l.MessageCard({header:r.Loc.getMessage("LANDING_FORM_CALLBACK_WARNING_HEADER"),description:r.Loc.getMessage("LANDING_FORM_CALLBACK_WARNING_TEXT"),angle:false,closeable:false,hideActions:true,context:"warning"})}))}},{key:"isAvailable",value:function e(){var t=this;return this.cache.remember("isAvailable",(function(){return t.options.dictionary.callback.from.length>0}))}},{key:"getSettingsForm",value:function e(){var n=this;return this.cache.remember("settingsForm",(function(){return new a.FormSettingsForm({title:r.Loc.getMessage("LANDING_FORM_SETTINGS_CALLBACK_USE_CHECKBOX_LABEL"),toggleable:true,toggleableType:a.FormSettingsForm.ToggleableType.Switch,opened:n.isAvailable()&&t.Text.toBoolean(n.options.formOptions.callback.use),fields:[n.getPhoneListField(),n.getTextField()]})}))}},{key:"getUseCheckboxField",value:function e(){var n=this;return this.cache.remember("useCheckboxField",(function(){return new BX.Landing.UI.Field.Checkbox({selector:"use",compact:true,value:[t.Text.toBoolean(n.options.formOptions.callback.use)],items:[{name:r.Loc.getMessage("LANDING_FORM_SETTINGS_CALLBACK_USE_CHECKBOX_LABEL"),value:true}]})}))}},{key:"getPhoneListField",value:function e(){var t=this;return this.cache.remember("phoneListField",(function(){return new BX.Landing.UI.Field.Dropdown({selector:"from",title:r.Loc.getMessage("LANDING_FORM_SETTINGS_CALLBACK_PHONE_TITLE"),content:t.options.formOptions.callback.from,items:[{name:r.Loc.getMessage("LANDING_FORM_DEFAULT_PHONE_NOT_SELECTED"),value:""}].concat(babelHelpers.toConsumableArray(t.options.dictionary.callback.from.map((function(e){return{name:e.name,value:e.id}}))))})}))}},{key:"getTextField",value:function e(){var t=this;return this.cache.remember("textField",(function(){return new o.TextField({selector:"text",title:r.Loc.getMessage("LANDING_FORM_SETTINGS_CALLBACK_TEXT_TITLE"),content:t.options.formOptions.callback.text,textOnly:true})}))}},{key:"valueReducer",value:function e(t){return{callback:g(g({},t),{},{use:this.getSettingsForm().isOpened()})}}},{key:"onChange",value:function e(t){this.emit("onChange",g(g({},t.getData()),{},{skipPrepare:true}))}}]);return n}(i.ContentWrapper);e.default=u})(this.BX.Landing.Ui.Panel.Formsettingspanel.Content=this.BX.Landing.Ui.Panel.Formsettingspanel.Content||{},BX,BX.Event,BX.Landing,BX.Landing.UI.Panel,BX.Landing.UI.Form,BX.Landing.UI.Card,BX.Landing.UI.Field,BX.Landing.UI.Card);
//# sourceMappingURL=callback.bundle.map.js